Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: opt-out ssm parameters for github app #4335

Merged
merged 30 commits into from
Feb 24, 2025
Merged

Conversation

AppliNH
Copy link
Contributor

@AppliNH AppliNH commented Jan 6, 2025

Hi! 👋

Throughout my recent experiences, we had strong requirements to not have secret values in the state. To handle that, I suggest to make optional the creation of SSM parameters as part of the regular flow so it doesn't leak secrets in Terraform state.

We could alternatively use the latest ephemeral feature, but I'm not sure everyone is using Terraform 1.10+ atm since it's quite recent. I also think relying on ephemerals should be part of a new breaking release as it won't be compatible with Terraform < 1.10.

Let me know what you think of this!

@npalm npalm self-requested a review January 9, 2025 14:00
Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AppliNH thx for the contribution.

Supporting external maanaged ssm parameters is fine. A view things to consider are

  • Update docs see docs dir to explain the usages
  • Explain or express via an example how to ajust the policies so the lambda can access the secrets. Lambda roles are exported.
  • I have added a comment related to the variables you introduces. I think it can done in a single app variable. Which avoid the introdduction of new variables. It also makes it easier to validat the variable.

@AppliNH AppliNH requested review from a team as code owners February 13, 2025 14:00
@AppliNH AppliNH requested a review from npalm February 13, 2025 14:42
@AppliNH
Copy link
Contributor Author

AppliNH commented Feb 13, 2025

Hi 👋 Really sorry for the delay, I've been terribly busy. I've updated everything, let me know what you think of it!

Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am busy with the review. I am fine with the approach. Please can you update the docs as well, see this page: https://github-aws-runners.github.io/terraform-aws-github-runner/configuration/ I think we should add this as major configuration choice. and / or make a remark in the ssm paramater section.

Please can you also make a note that the provided value has preference ofer the ssm paramater, at least this is the current order in reading the values via the terraform function coalense

I have tested th default example (with pool). Need to test the added example and the multi runners as well.

@AppliNH
Copy link
Contributor Author

AppliNH commented Feb 18, 2025

Please can you also make a note that the provided value has preference ofer the ssm paramater, at least this is the current order in reading the values via the terraform function coalense

@npalm
Reading the coalesce documentation, the SSM parameter has preference over the the value though.
Do you suggest it should be done otherwise?

Right now it's

github_app_parameters = {
    id             = coalesce(var.github_app.id_ssm, module.ssm.parameters.github_app_id)
    key_base64     = coalesce(var.github_app.key_base64_ssm, module.ssm.parameters.github_app_key_base64)
    webhook_secret = coalesce(var.github_app.webhook_secret_ssm, module.ssm.parameters.github_app_webhook_secret)
  }

@npalm
Copy link
Member

npalm commented Feb 18, 2025

Would keep the order in this way

@npalm
Copy link
Member

npalm commented Feb 19, 2025

@AppliNH I think we are all most done. I have tested the relevant examples and the newly added example. Also made some changes directly to the PR. Let me know what you think.

@AppliNH AppliNH requested a review from npalm February 20, 2025 15:18
Copy link
Contributor Author

@AppliNH AppliNH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed and tested it all again, LGTM!
It's provisioned in production for us 👌

@npalm npalm changed the title feat: make ssm parameters automatic creation optional to avoid having sensitive data in the state feat: opt-out ssm parameters for github app Feb 24, 2025
@npalm npalm merged commit a2f013f into github-aws-runners:main Feb 24, 2025
42 checks passed
npalm pushed a commit that referenced this pull request Feb 24, 2025
🤖 I have created a release *beep* *boop*
---


##
[6.3.0](v6.2.3...v6.3.0)
(2025-02-24)


### Features

* opt-out ssm parameters for github app
([#4335](#4335))
([a2f013f](a2f013f))
@AppliNH


### Bug Fixes

* **lambda:** bump the aws group in /lambdas with 6 updates
([#4440](#4440))
([b10d87e](b10d87e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants